package com.myhome.money.dubbo;

import com.myhome.money.dubbo.consumer.ConsumerConfiguration;
import com.myhome.money.dubbo.consumer.FooConsumer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author: 许路路
 * @Date: 2019/8/20
 */
public class FooConsumerBootstrap {

    public static void main(String[] args) throws Exception {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(ConsumerConfiguration.class);
        context.refresh();
        System.out.println("consumer is ready...");
        FooConsumer fooConsumer = context.getBean(FooConsumer.class);
        String res = fooConsumer.hello();
        System.out.println("consumer sayHi print:" + res);
        res = fooConsumer.getStudent();
        System.out.println("consumer getStudent print:" + res);

        //demo
        fooConsumer.demo();

        //回调测试
        //fooConsumer.callBack();

        System.in.read();
    }
}
